3.1.17 \(\int \cot ^3(c+d x) (a+a \sin (c+d x))^2 \, dx\) [17]

Optimal. Leaf size=30 \[ -\frac {\csc ^2(c+d x) (a+a \sin (c+d x))^4}{2 a^2 d} \]

[Out]

-1/2*csc(d*x+c)^2*(a+a*sin(d*x+c))^4/a^2/d

________________________________________________________________________________________

Rubi [A]
time = 0.03, antiderivative size = 30, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.095, Rules used = {2786, 75} \begin {gather*} -\frac {\csc ^2(c+d x) (a \sin (c+d x)+a)^4}{2 a^2 d} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Cot[c + d*x]^3*(a + a*Sin[c + d*x])^2,x]

[Out]

-1/2*(Csc[c + d*x]^2*(a + a*Sin[c + d*x])^4)/(a^2*d)

Rule 75

Int[((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> Simp[b*(c + d*x)^
(n + 1)*((e + f*x)^(p + 1)/(d*f*(n + p + 2))), x] /; FreeQ[{a, b, c, d, e, f, n, p}, x] && NeQ[n + p + 2, 0] &
& EqQ[a*d*f*(n + p + 2) - b*(d*e*(n + 1) + c*f*(p + 1)), 0]

Rule 2786

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*tan[(e_.) + (f_.)*(x_)]^(p_.), x_Symbol] :> Dist[1/f, Subst[I
nt[x^p*((a + x)^(m - (p + 1)/2)/(a - x)^((p + 1)/2)), x], x, b*Sin[e + f*x]], x] /; FreeQ[{a, b, e, f, m}, x]
&& EqQ[a^2 - b^2, 0] && IntegerQ[(p + 1)/2]

Rubi steps

\begin {align*} \int \cot ^3(c+d x) (a+a \sin (c+d x))^2 \, dx &=\frac {\text {Subst}\left (\int \frac {(a-x) (a+x)^3}{x^3} \, dx,x,a \sin (c+d x)\right )}{d}\\ &=-\frac {\csc ^2(c+d x) (a+a \sin (c+d x))^4}{2 a^2 d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.03, size = 28, normalized size = 0.93 \begin {gather*} -\frac {a^2 \csc ^2(c+d x) (1+\sin (c+d x))^4}{2 d} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Cot[c + d*x]^3*(a + a*Sin[c + d*x])^2,x]

[Out]

-1/2*(a^2*Csc[c + d*x]^2*(1 + Sin[c + d*x])^4)/d

________________________________________________________________________________________

Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(93\) vs. \(2(28)=56\).
time = 0.21, size = 94, normalized size = 3.13

method result size
derivativedivides \(\frac {a^{2} \left (\frac {\left (\cos ^{2}\left (d x +c \right )\right )}{2}+\ln \left (\sin \left (d x +c \right )\right )\right )+2 a^{2} \left (-\frac {\cos ^{4}\left (d x +c \right )}{\sin \left (d x +c \right )}-\left (2+\cos ^{2}\left (d x +c \right )\right ) \sin \left (d x +c \right )\right )+a^{2} \left (-\frac {\left (\cot ^{2}\left (d x +c \right )\right )}{2}-\ln \left (\sin \left (d x +c \right )\right )\right )}{d}\) \(94\)
default \(\frac {a^{2} \left (\frac {\left (\cos ^{2}\left (d x +c \right )\right )}{2}+\ln \left (\sin \left (d x +c \right )\right )\right )+2 a^{2} \left (-\frac {\cos ^{4}\left (d x +c \right )}{\sin \left (d x +c \right )}-\left (2+\cos ^{2}\left (d x +c \right )\right ) \sin \left (d x +c \right )\right )+a^{2} \left (-\frac {\left (\cot ^{2}\left (d x +c \right )\right )}{2}-\ln \left (\sin \left (d x +c \right )\right )\right )}{d}\) \(94\)
risch \(\frac {a^{2} {\mathrm e}^{2 i \left (d x +c \right )}}{8 d}+\frac {i a^{2} {\mathrm e}^{i \left (d x +c \right )}}{d}-\frac {i a^{2} {\mathrm e}^{-i \left (d x +c \right )}}{d}+\frac {a^{2} {\mathrm e}^{-2 i \left (d x +c \right )}}{8 d}-\frac {2 i a^{2} \left (i {\mathrm e}^{2 i \left (d x +c \right )}+2 \,{\mathrm e}^{3 i \left (d x +c \right )}-2 \,{\mathrm e}^{i \left (d x +c \right )}\right )}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )^{2}}\) \(129\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cot(d*x+c)^3*(a+a*sin(d*x+c))^2,x,method=_RETURNVERBOSE)

[Out]

1/d*(a^2*(1/2*cos(d*x+c)^2+ln(sin(d*x+c)))+2*a^2*(-1/sin(d*x+c)*cos(d*x+c)^4-(2+cos(d*x+c)^2)*sin(d*x+c))+a^2*
(-1/2*cot(d*x+c)^2-ln(sin(d*x+c))))

________________________________________________________________________________________

Maxima [A]
time = 0.27, size = 53, normalized size = 1.77 \begin {gather*} -\frac {a^{2} \sin \left (d x + c\right )^{2} + 4 \, a^{2} \sin \left (d x + c\right ) + \frac {4 \, a^{2} \sin \left (d x + c\right ) + a^{2}}{\sin \left (d x + c\right )^{2}}}{2 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)^3*(a+a*sin(d*x+c))^2,x, algorithm="maxima")

[Out]

-1/2*(a^2*sin(d*x + c)^2 + 4*a^2*sin(d*x + c) + (4*a^2*sin(d*x + c) + a^2)/sin(d*x + c)^2)/d

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 76 vs. \(2 (28) = 56\).
time = 0.35, size = 76, normalized size = 2.53 \begin {gather*} \frac {2 \, a^{2} \cos \left (d x + c\right )^{4} - 3 \, a^{2} \cos \left (d x + c\right )^{2} + 3 \, a^{2} - 8 \, {\left (a^{2} \cos \left (d x + c\right )^{2} - 2 \, a^{2}\right )} \sin \left (d x + c\right )}{4 \, {\left (d \cos \left (d x + c\right )^{2} - d\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)^3*(a+a*sin(d*x+c))^2,x, algorithm="fricas")

[Out]

1/4*(2*a^2*cos(d*x + c)^4 - 3*a^2*cos(d*x + c)^2 + 3*a^2 - 8*(a^2*cos(d*x + c)^2 - 2*a^2)*sin(d*x + c))/(d*cos
(d*x + c)^2 - d)

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} a^{2} \left (\int 2 \sin {\left (c + d x \right )} \cot ^{3}{\left (c + d x \right )}\, dx + \int \sin ^{2}{\left (c + d x \right )} \cot ^{3}{\left (c + d x \right )}\, dx + \int \cot ^{3}{\left (c + d x \right )}\, dx\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)**3*(a+a*sin(d*x+c))**2,x)

[Out]

a**2*(Integral(2*sin(c + d*x)*cot(c + d*x)**3, x) + Integral(sin(c + d*x)**2*cot(c + d*x)**3, x) + Integral(co
t(c + d*x)**3, x))

________________________________________________________________________________________

Giac [A]
time = 3.62, size = 47, normalized size = 1.57 \begin {gather*} -\frac {a^{2} {\left (\frac {1}{\sin \left (d x + c\right )} + \sin \left (d x + c\right )\right )}^{2} + 4 \, a^{2} {\left (\frac {1}{\sin \left (d x + c\right )} + \sin \left (d x + c\right )\right )}}{2 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cot(d*x+c)^3*(a+a*sin(d*x+c))^2,x, algorithm="giac")

[Out]

-1/2*(a^2*(1/sin(d*x + c) + sin(d*x + c))^2 + 4*a^2*(1/sin(d*x + c) + sin(d*x + c)))/d

________________________________________________________________________________________

Mupad [B]
time = 6.67, size = 56, normalized size = 1.87 \begin {gather*} -\frac {a^2\,\left (2\,{\sin \left (c+d\,x\right )}^4+8\,{\sin \left (c+d\,x\right )}^3-{\sin \left (c+d\,x\right )}^2+8\,\sin \left (c+d\,x\right )+2\right )}{4\,d\,{\sin \left (c+d\,x\right )}^2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cot(c + d*x)^3*(a + a*sin(c + d*x))^2,x)

[Out]

-(a^2*(8*sin(c + d*x) - sin(c + d*x)^2 + 8*sin(c + d*x)^3 + 2*sin(c + d*x)^4 + 2))/(4*d*sin(c + d*x)^2)

________________________________________________________________________________________